import request from "@/axios"

//所有的开课
export function all(page) {
    let limit = 10
    let url = '/api/course/all'
    let params = {page,limit}
    return request.get(url,{params})
}

export function info(courseId) {
    let url = '/api/course/info'
    let params = {courseId}
    return request.get(url,{params})
}

//当前产品预报名的开班
export function list(goodsId) {
    let url = '/api/course/list'
    let params = {goodsId}
    return request.get(url,{params})
}

//激活课程
export function active(storeId) {
    let url = '/api/course/card/create'
    let data = {storeId}
    return request.post(url, data)
}

//卡片列表
export function listCard() {
    let url = '/api/course/card/list'
    return request.get(url)
}

//赠送卡券
export function sendCard(toUserId,cardId) {
    let url = '/api/course/card/send'
    let data = {toUserId,cardId}
    return request.post(url,data)
}

//扫卡券
export function scan(code) {
    let url = '/api/course/card/scan'
    let data = {code}
    return request.post(url,data)
}

//报名
export function sign(sign) {
    let url = '/api/course/sign'
    sign.Loading = true
    return request.post(url,sign)
}

//获取报名
export function getSign(signId) {
    let url = '/api/course/sign/info'
    let params = {signId}
    return request.get(url,params)

}

//报名列表
export function listSign() {
    let url = '/api/course/sign/list'
    return request.get(url)
}

//确认报名
export function confirm(signId) {
    let url = '/api/course/sign/confirm'
    let data = {signId}
    return request.post(url,data)
}

//删除报名
export function deleteSign(signId) {
    let url = '/api/course/sign/remove'
    let data = {signId}
    return request.post(url,data)
}






